<?php
$blogname = empty($userInfo->blogname)?'网站名称':$userInfo->blogname;
$blogurl = empty($userInfo->blogurl)?'网站地址(http://)':$userInfo->blogurl;
?>
<div id="container" class="clear">
	<div id="left">
		<form action='<?php echo url::site('user/savesetting'); ?>' method='post' id="savesetting">
		<p class="moreOptionBtn arrowDown fwb">基本设置</p>
			<div class="moreOption mt10 p10">
				<p>个人网站</p>
				<input type="text" name="blogname" value="<?php echo $blogname; ?>" <?php if(!empty($userInfo->blogname)) echo 'protected';?> class="w150 p5 mr10 <?php echo empty($userInfo->blogname)?'gray':''; ?>" />
				<input type="text" name="blogurl" value="<?php echo $blogurl; ?>" <?php if(!empty($userInfo->blogurl)) echo 'protected';?> class="w400 p5 <?php echo empty($userInfo->blogurl)?'gray':''; ?>" />

				<p class="mt10">用户名(可以是中文)</p>
				<input protected type="text" name="username" value="<?php echo $userInfo->username;?>" class="w250 p5"/>

				<p class="mt10">邮箱</p>
				<input protected type="text" name="email" value="<?php echo $userInfo->email ?>" class="w250 p5"/>
			</div>
			
			<p class="moreOptionBtn fwb mt20">语言偏好设置</p>
			<div class="moreOption mt10 p10 hide">
			<input type="text" name="lan" value="" class="p5 w250" id="settingLan"/>
			</div>

			<!--
			<p class="moreOptionBtn fwb mt20">API KEY</p>
			<div class="moreOption mt10 p10 hide">
				<p>c4579586f1a90372f762cb69d4rd <a href="#">如何使用API</a></p>
			</div>
			-->

			<p><input type="submit" name="" value="确定修改" class="mt10" /></p>
		</form>
	</div>
	
</div>

<script type='text/javascript'>
var t = new TextboxList('#settingLan',{unique:true,plugins:{autocomplete:{placeholder:'请输入编程语言'}}});
		//t.add('PHP').add('ACTIONSCRIPT3').add('jQuery');
<?php $lan = explode(',',$userInfo->lan);
echo '$("#settingLan").data("lan","'.$userInfo->lan.'");'."\n";
foreach($lan as $l){
	echo 't.add("'.$l.'");'."\n";
}
?>
		t.getContainer().addClass('textboxlist-loading');
		$.ajax({url: '<?php echo url::site('getlan'); ?>', dataType: 'json', success: function(r)
			{
				t.plugins['autocomplete'].setValues(r);
				t.getContainer().removeClass('textboxlist-loading');
			}
	}); 
</script>
